home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13606 < prev    next >
Encoding:
Text File  |  1996-08-05  |  787 b   |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: gail.ripco.com!mambuhl
  3. From: mambuhl@ripco.com (Martin Ambuhl)
  4. Subject: Re: PLEASE HELP!!!       
  5. Message-ID: <DpL12o.DLC@rci.ripco.com>
  6. X-Nntp-Sender: mambuhl@golden.ripco.com
  7. Sender: usenet@rci.ripco.com (Net News Admin)
  8. Organization: Ripco Internet BBS Chicago
  9. Date: Tue, 9 Apr 1996 06:37:36 GMT
  10.  
  11. b3503104@cc.ntu.edu.tw (b3503104) in <4k25rv$l4s@netnews.ntu.edu.tw>
  12. asks:
  13.  
  14.  
  15. > How can I write a program in C to have the similar function as "dir" in DOS?
  16. >??
  17. >  (that is to LIST the files)
  18.  
  19. >Any suggestions or hints will be very helpful and appreciated!!
  20.  
  21. #include <stdlib.h>
  22.  
  23. int main()
  24. {
  25.         system("dir");  /* for your DOS-based implementation */
  26.         return 0;
  27. }
  28.         
  29. --
  30. * Martin Ambuhl       net: mambuhl@ripco.com
  31. * Chicago, IL (USA)    
  32.